<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

//后台路由
Route::group(['prefix'=>'admin','namespace'=>'Admin'],function (){
    Route::get('login','AuthController@login_view');
    Route::post('login','AuthController@login');
    Route::get('out','AuthController@out');
    Route::get('index','IndexController@index');
    Route::get('welcome','IndexController@welcome');

    Route::get('list','IndexController@admin_list');
    Route::get('role','IndexController@role');
    Route::get('permission','IndexController@permission');
    Route::get('topic','IndexController@topic');
    Route::get('picture','IndexController@picture');
});

//前台路由
Route::group(['prefix'=>'','namespace'=>'Home'],function (){
    //首页、认证界面
    Route::get('','IndexController@index');
    Route::get('login','IndexController@login_view');
    Route::get('register','IndexController@register_view');
    Route::get('out','IndexController@land_out');
    Route::post('search','IndexController@search');
    //用户认证
    Route::post('login','AuthController@login');
    Route::post('register','AuthController@register');
    Route::post('register/emailCheck','AuthController@emailCheck');
    //版块分类
    Route::get('list','SectionsController@section_list');
    Route::get('section_list/section={id}','SectionsController@section_list_view');
    Route::post('section_list_change','SectionsController@sectionList_change');
    Route::post('section_list_add','SectionsController@sectionList_add');
    Route::post('section_list_class_add','SectionsController@sectionList_class_add');
    Route::get('section_list/section={id}/{class}','SectionsController@section_list_best_view');
    //用户中心
    Route::get('userCenter/user={id}','UserCenterController@user_view');
    Route::get('myUserCenter','UserCenterController@myUserCenter_view')->Middleware('login_user');
    Route::get('profile_update','UserCenterController@profile_update_view')->Middleware('login_user');
    Route::post('profile_update','UserCenterController@profile_update');
    //关注
    Route::get('follow/another={id}','UserCenterController@followUp');
    Route::get('followDown/another={id}','UserCenterController@followDown');
    //Ta的动态
    Route::post('Ta_follow','UserCenterController@Ta_follow');
    Route::post('Ta_vote','UserCenterController@Ta_vote');
    Route::post('Ta_reply','UserCenterController@Ta_reply');
    Route::post('Ta_topic','UserCenterController@Ta_topic');
    Route::post('Ta_follower','UserCenterController@Ta_follower');
    //消息提醒
    Route::get('user_msg','UserCenterController@user_msg_view')->Middleware('login_user');
    Route::get('user_msg_get','UserCenterController@user_msg')->Middleware('login_user');
    Route::get('user_msg_topic','UserCenterController@msg_topic')->Middleware('login_user');
    Route::get('reminds','UserCenterController@reminds_view')->Middleware('login_user');
    Route::post('remind/read','UserCenterController@remind_read');
    //文章处理
    Route::get('topic/topics={id}','TopicsController@topic_content');
    Route::get('topic_post','TopicsController@topic_postView')->Middleware('login_user');
    Route::post('topic_post','TopicsController@topic_post');
    Route::post('topic_image','TopicsController@topic_image');
    Route::post('delete_topic','TopicsController@delete_topic');
    //评论
    Route::post('reply_add','TopicsController@reply_add');
    Route::post('answer_add','TopicsController@answer_add');
    Route::post('delete_reply','TopicsController@delete_reply');
    //文章修改
    Route::get('update_topic_view/topic={id}','TopicsController@update_topic_view')->Middleware('login_user');
    Route::post('topic_update/topic={id}','TopicsController@update_topic');
    //点赞
    Route::post('topic/upVote','TopicsController@upVote');
    Route::post('topic/voteDown','TopicsController@voteDown');
});
